/*
 * GraphState2.h
 *
 *  Created on: Jun 28, 2011
 *      Author: pickrell
 */

#ifndef TREE_H_
#define TREE_H_

#include "Settings.hpp"
#include "PopGraph.h"
#include "CountData.h"
#include "PhyloPop_params.h"
#include "nnls.h"
#include <gsl/gsl_sf_gamma.h>
#include "Alignment.h"


class Tree{
public:
	Tree();
	Tree(string);
	//Tree(Alignment *);
	PopGraph* tree;
	int npop;
	Alignment *aln;
	//set the graph structure to a Newick string
	void set_graph(string);
	void set_graph_from_file(string);
	void set_graph_from_string(string);
	void set_countdata(CountData*);
	//set graph from files with the vertices and edges
	void set_graph(string, string);
	map<Graph::vertex_descriptor, int> get_v2index();

	//print coalescent times
	void print_coales();
	void set_coaltimes();
	void set_labeled_coaltimes();
	vector<double> coaltimes;
	vector<double> coaltimes1, coaltimes2, coaltimes3;
	void init_tip_labels(double, gsl_rng *);
	void assign_labels(Graph::vertex_descriptor, int);
	void assign_labels(Graph::vertex_descriptor, gsl_rng*, double);
	void set_heights();
	double llk(vector<double>*, vector<double>*);
	double llk(int, vector<double>, vector<double>*, vector<double>*);

	void print();

};

#endif /* TREE_H_ */
